{% extends "admin/change_form.html" %}
{% load i18n admin_modify adminmedia %}

{% block extrahead %}{{ block.super }}
{% url admin:jsi18n as jsi18nurl %}
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<script type="text/javascript" src="{{ jsi18nurl|default:"../../../jsi18n/" }}"></script>
{{ media }}
<script type="text/javascript" >
(function($) {
  $(document).ready(function ($){
		$('.inline-group h2').click(function(){
			if($('.inline-related').is(':visible')) $('.inline-related').hide('slow');
			else $('.inline-related').show();
		});
  });
})(django.jQuery);
</script>
{% endblock %}

{% block extrastyle %}{{ block.super }}
<link rel="stylesheet" type="text/css" href="{% admin_media_prefix %}css/forms.css" />
<link rel="stylesheet" type="text/css" href="{{ MEDIA_REAL_ESTATE }}admin/css/forms.css" />
<style type="text/css">
  .username {
    display: none;
  }
  .tab-content {
    border-top-color: #EEEEEE;
    border-top-style: solid;
    border-top-width: 1px; 
  }
</style>
{% endblock %}

{% block coltype %}{% if ordered_objects %}colMS{% else %}colM{% endif %}{% endblock %}

{% block bodyclass %}{{ opts.app_label }}-{{ opts.object_name.lower }} change-form{% endblock %}

{% block breadcrumbs %}{% if not is_popup %}
   <ul class="breadcrumb">
      <li><a href="{% url admin:index %}"><i class="icon-home" ></i>{% trans "Home" %}</a> <span class="divider">/</span></li>
      {% if opts.app_label == "auth" %}
        {% if perms.auth %}
          <li >{% if has_change_permission %}<a href="../">{{ opts.verbose_name_plural|capfirst }}</a>{% else %}{{ opts.verbose_name_plural|capfirst }}{% endif %} <span class="divider">/</span></li> 
        {% endif %}
      {% else %}
          <li >{% if has_change_permission %}<a href="../">{{ opts.verbose_name_plural|capfirst }}</a>{% else %}{{ opts.verbose_name_plural|capfirst }}{% endif %} <span class="divider">/</span></li> 
      {% endif %}
      <li >{% if add %}{% trans "Add" %} {{ opts.verbose_name }}{% else %}{{ original|truncatewords:"18" }}{% endif %}</li>
    </ul>
{% endif %}{% endblock %}

{% block content %}<div id="content-main">
{% block object-tools %}
{% if change %}
  {% if not is_popup %}
        <a href="history/" class="btn pull-right"><i class="icon-list-alt"></i> {% trans "History" %}</a>
    {% if opts.app_label == "auth" %}
      {% if perms.auth.user %}
        {% if has_absolute_url %}<a href="../../../r/{{ content_type_id }}/{{ object_id }}/" class="btn pull-right"><i class="icon-eye-open"></i> {% trans "View on site" %}</a>{% endif %}
      {% endif %}
    {% else %}
        {% if has_absolute_url %}<a href="../../../r/{{ content_type_id }}/{{ object_id }}/" class="btn pull-right"><i class="icon-eye-open"></i> {% trans "View on site" %}</a>{% endif %}
    {% endif %}
  {% else %}
  <ul class="object-tools">
      <li><a href="../?pop=1" class="historylink">{% trans "Manage list" %}</a></li>
  </ul>
  {% endif %}
{% else %}
  {% if is_popup %}
    <a href="../?pop=1" class="btn"><i class="icon-list-alt"></i> {% trans "Manage list" %}</a></li>
  {% endif %}
{% endif %}
{% endblock %}

<form {% if has_file_field %}enctype="multipart/form-data" {% endif %}action="{{ form_url }}" method="post" id="{{ opts.module_name }}_form">{% csrf_token %}{% block form_top %}{% endblock %}

{% if is_popup %}<input type="hidden" name="_popup" value="1" />{% endif %}
{% if save_on_top %}{% submit_row %}{% endif %}
{% if errors %}
    <div class="alert alert-error">
      {% blocktrans count errors|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %}
    </div>
    {{ adminform.form.non_field_errors }}
{% endif %}
<div class="tab-content">
{% for fieldset in adminform %}
	  {% include "admin/realtors/includes/fieldset-custom.html" %}
{% endfor %}

{% for inline_admin_formset in inline_admin_formsets %}
    {% include inline_admin_formset.opts.template %}
{% endfor %}

{% block after_related_objects %}{% endblock %}
</div>
{% submit_row %}

{% if adminform and add %}
   <script type="text/javascript">document.getElementById("{{ adminform.first_field.auto_id }}").focus();</script>
{% endif %}

{# JavaScript for prepopulated fields #}
{% prepopulated_fields_js %}

</form></div>
{% endblock %}
